package cn.le.helloWorld;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

/**
 * 项目名  spring-boot
 * Created by lansp
 * Created at 2018/5/31
 * 描述: 消息消费者
 */
@Component
@RabbitListener(queues = "hello") //定义该类对hello队列的监听
public class Receiver{

	private RabbitTemplate rabbitTemplate;

	@RabbitHandler //此注解用来指定消费者的处理方法,所以该消费者实现了对hello队列的消费,消费操作为输出消息的字符内容
	public void preocess(String hello){
		System.out.println("Receiver : " + hello);
	}



}
